package com.demo.supplier.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 供应商信息VO
 * 
 * @author demo
 */
@Data
@ApiModel("供应商信息VO")
public class SupplierVo {

    @ApiModelProperty("供应商ID")
    private Long id;

    @ApiModelProperty("供应商编码")
    private String supplierCode;

    @ApiModelProperty("供应商名称")
    private String supplierName;

    @ApiModelProperty("联系人")
    private String contactPerson;

    @ApiModelProperty("联系电话")
    private String contactPhone;

    @ApiModelProperty("联系邮箱")
    private String contactEmail;

    @ApiModelProperty("地址")
    private String address;

    @ApiModelProperty("营业执照号")
    private String businessLicense;

    @ApiModelProperty("信用等级")
    private String creditRating;

    @ApiModelProperty("状态：1=启用，0=禁用")
    private Integer status;

    @ApiModelProperty("状态描述")
    private String statusDesc;

    @ApiModelProperty("Logo图片URL")
    private String logoUrl;

    @ApiModelProperty("描述")
    private String description;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    public String getStatusDesc() {
        return status != null ? (status == 1 ? "启用" : "禁用") : "";
    }
}